package com.mornd.gulimall.order.service;

import com.mornd.gulimall.apis.order.to.OrderPageTo;
import com.mornd.gulimall.apis.order.to.OrderTo;
import com.mornd.gulimall.apis.seckill.to.SeckillOrderTo;
import com.mornd.gulimall.order.config.pay.AliPay;
import com.mornd.gulimall.order.config.pay.AliPayAsyncVo;
import com.mornd.gulimall.order.entity.Order;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mornd.gulimall.order.entity.vo.OrderConfirmVO;
import com.mornd.gulimall.order.entity.vo.OrderSubmitVo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 订单 服务类
 * </p>
 *
 * @author mornd
 * @since 2023-07-22
 */
public interface IOrderService extends IService<Order> {
    OrderConfirmVO confirmOrder(Map<String, String> params);

    Order submitOrder(OrderSubmitVo orderSubmitVo);

    /**
     * 关单
     * @param order
     */
    void closeOrder(Order order);

    /**
     * 生成订单支付信息
     * @param orderSn
     * @return
     */
    AliPay getPayInfo(String orderSn);

    /**
     * 分页查询当前登录用户的所有订单信息
     * @param orderPageTo
     * @return
     */
    OrderPageTo pageWithItemByUser(OrderPageTo orderPageTo);

    /**
     * 处理支付成功后，平台的异步回调通知请求
     * @param vo
     * @return
     */
    void handlePayedResult(AliPayAsyncVo vo);

    /**
     * 处理秒杀单
     * @param seckillOrderTo
     */
    void createSeckillOrder(SeckillOrderTo seckillOrderTo);
}
